<template>
  <div class="header">
    <div class="header-container" style="height: 50px;">
        <nav class="main-navigation" style="height: 50px;">
            <ul style="margin-top: 14px">
                <li><a href="/home">首页</a></li>
                <li><a href="/about">关于</a></li>
                <li><a href="/lastanalyse">最近分析</a></li>
                <li><a href="/demo/main">样例Demo</a></li>
            </ul>
        </nav>
        <el-button size="medium" round style="margin-left: auto"
        @click="login">
          Login
        </el-button>
        <el-button size="medium" round @click="register"
        >Register</el-button>
    </div>
  </div>
</template>

<script>
export default {
  data() {
    return {
      title: '顶部信息框'
    }
  },
  methods:{
    login() {
      this.$router.push({path:'/Login'})
    },
    register() {
      this.$router.push({path:'/Register'})
    }
  },
}
</script>

<style>
.el-dropdown-link {
  cursor: pointer;
  color: #ccc;
  transition: filter 0.3s;
}
.el-dropdown-link:hover {
  color: white;
}
.el-main {
    background-color: #E9EEF3;
    color: #333;
    text-align: center;
    line-height: 160px;
  }
/* 设置网页头部框的样式 */
.header {
  width: 100%; /* 宽度占据全屏 */
  background-color: black; /* 背景颜色 */
  color: white; /* 字体颜色 */
  height: 50px;
  text-align: left; /* 文本居中 */
  padding: 20 0; /* 上下边距 */
  position: fixed; /* 固定定位 */
  top: 0; /* 顶部对齐 */
  left: 0; /* 左边对齐 */
  z-index: 1000; /* 确保悬浮于页面其他内容之上 */
  
}
.header-container {
    max-width: 2000px;
    margin: auto;
    display: flex;
    justify-content: space-between;
    align-items: center;
    flex-wrap: wrap;
}

.main-navigation {
    display: flex;
    left: 750px; 
    /* flex: 1; */
}

.main-navigation ul {
    list-style-type: none;
    padding: 0;
    display: flex;
}

.main-navigation ul li a {
    text-decoration: none;
    color: #ccc;
    padding: 0 25px;
    display: block;
    transition: filter 0.3s;
}
.main-navigation ul li a:hover{
  color: white;
}

.search-bar {
    display: flex;
    
}

.search-bar input[type="text"] {
    border: 1px solid #ccc;
    padding: 5px;
}

.search-bar button {
    padding: 5px 10px;
    border: none;
    background-color: #333;
    color: white;
    cursor: pointer;
}

.search-bar button:hover {
    background-color: #555;
}
.person{
  display: flex;
  padding: 5px 10px;
  border: none;
  color: #ccc;
  right: 40px;
  transition: filter 0.3s;
}

.person:hover{
  color: white;
}
</style>